function isDateString (dateString) {
  var regex = /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/
  if (regex.test(dateString)) {
    var dt = Date.parse(dateString)
    return !isNaN(dt)
  } else {
    return false
  }
}

function isCountString (intString) {
  var regex = /^[1-9]\d*$/
  return regex.test(intString)
}

function isClassType (type) {
  var regex = /^market$|^amount$|^same$/
  return regex.test(type)
}

module.exports = {
  isValidDateString: isDateString,
  isValidCountString: isCountString,
  isValidClassType: isClassType
}